<?php


namespace App\Http\Controllers\Api;
use App\Http\Controllers\BaseController;
use App\Models\Bank;
use Dingo\Api\Http\Request;

class BankController extends BaseController
{
    /**
     * 列表
     * @param Request $request
     * @return mixed
     */
    public function index(Request $request) {
        $bank_name = \request('bank_name');
        $users = Bank::when($bank_name, function ($q) use($bank_name) {
            $q->where('bank_name', 'like', '%' . $bank_name. '%');
        })->orderBy('id', 'asc')
            ->paginate(\request('per_page', 20));
        return $this->paginate($users);
    }

}

